<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //用户个人信息表
        Schema::create ('user_info', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->uuid ('id')->primary ('id');//uuid主键
            $table->tinyInteger ('sex')->default(0);//性别
            $table->string ('real_name', 20);//真实姓名
            $table->string ('id_card', 18)->unique ();//身份证号
            $table->date ('birthday')->nullable();//生日
            $table->string ('live_address', 120)->default('');//居住地址
            $table->tinyInteger ('nation')->default(0);//民族
            $table->smallInteger ('register')->default(0);//户籍
            $table->tinyInteger ('blood')->default(0);//血型
            $table->tinyInteger ('marital')->default(0);//婚姻状况
            $table->tinyInteger ('category')->default(0);//类别：低保
            $table->tinyInteger ('living_condition')->default(0);//居住情况
            $table->tinyInteger ('finance')->default(0);//经济来源
            $table->tinyInteger ('physical')->default(0);//身体状况
            $table->tinyInteger ('education')->default(0);//文化程度
            $table->tinyInteger ('religion')->default(0);//宗教信仰
            $table->timestamps ();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists ('user_info');
    }
}
